import 'package:json_annotation/json_annotation.dart';

part 'request_error.model.g.dart';

@JsonSerializable()
class RequestError extends Object {
  @JsonKey(name: 'statusCode')
  int statusCode;

  @JsonKey(name: 'error')
  String error;

  @JsonKey(name: 'message')
  String message;

  RequestError(
    this.statusCode,
    this.error,
    this.message,
  );

  factory RequestError.fromJson(Map<String, dynamic> srcJson) =>
      _$RequestErrorFromJson(srcJson);

  Map<String, dynamic> toJson() => _$RequestErrorToJson(this);
}
